<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/style.css">
<title>八维贴吧后台管理系统</title>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery-3.2.1.js">
	
</script>
</head>
<body>
	<!-- 头部分 -->
	<jsp:include page="/WEB-INF/view/admin/header.jsp"></jsp:include>

	<div class="container-fluid">
		<div class="row">
			<!-- 左侧部分 -->
			<jsp:include page="/WEB-INF/view/admin/left.jsp"></jsp:include>

			<!-- ////自己开发的部分///////////// -->
			<div class="col9" style="height: 500px;">

				<h1 align="center">板块管理</h1>

				<form  id="pageFrm"
					action="${pageContext.request.contextPath}/admin/forum/edit"
					method="get">
					<button class="btn btn-danger" >开设版块</button>
				<table>
					<thead>

						<tr>
							<th>ID</th>
							<th>版块名称</th>
							<th>版块描述</th>
							<th>排序</th>
							<th>操作</th>
						</tr>

					</thead>

					<tbody>
						<c:forEach var="forum" items="${forums}">
							<tr>
							    <td>${forum.id }</td>
								<td>${forum.name }</td>
								<td align="center">${forum.description}</td>
								<td align="center">${forum.sorted}</td>
								<td><input type="button" class="btn btn-danger"  onclick="update(${forum.id })" value="修改"></td>
							</tr>

						</c:forEach>

					</tbody>
				</table>
	</form>
				<!-- 分页代码包含部分，注意page_num.jsp中的变量名称为pageInfo -->


			</div>

			<!-- ////自己开发的部分///////////// -->
		</div>
	</div>
<script type="text/javascript">
  function update(id){
	  location="${pageContext.request.contextPath}/admin/forum/edit?id="+id;
  }
</script>
</body>
</html>